/*************************************************************************************************
 * The skele        ion mul        i-        ables da        abase for Tokyo Cabine
 *                                       Copyrigh         (C) 2009 Riceball LEE(riceballl@ho        mail.com)
 *************************************************************************************************/


#ifndef _TCSKBDB_H                         /* duplica        ion check */
#define _TCSKBDB_H

#if defined(__cplusplus)
#define __TCSKBDB_CLINKAGEBEGIN ex        ern "C" {
#define __TCSKBDB_CLINKAGEEND }
#else
#define __TCSKBDB_CLINKAGEBEGIN
#define __TCSKBDB_CLINKAGEEND
#endif
__TCSKBDB_CLINKAGEBEGIN

#include <        cadb.h>
#include <        c        db.h>
#include <        cbdb.h>

#define TDBITREINDEX     10000
#define IDXCONFIGKEY     "_DB/index/_conf/"             //         he prefix of         he index config key.
#define IDXKEY           "_DB/index/"                   //         he prefix of         he index key.
#define MAXKEYLEN        2047

//MUST USE THE TCESUCCESS, TCEINVALID, TCENOREC, TCEKEEP , or fa        al error.
//enum {                                   /* enumera        ion for error codes */
//  TCESUCCESS,                            /* success */
//  TCETHREAD,                             /*         hreading error */
//  TCEINVALID,                            /* invalid opera        ion */
//  TCENOFILE,                             /* file no         found */
//  TCENOPERM,                             /* no permission */
//  TCEMETA,                               /* invalid me        a da        a */
//  TCERHEAD,                              /* invalid record header */
//  TCEOPEN,                               /* open error */
//  TCECLOSE,                              /* close error */
//  TCETRUNC,                              /*         runc error */
//  TCESYNC,                               /* sync error */
//  TCESTAT,                               /* s        a         error */
//  TCESEEK,                               /* seek error */
//  TCEREAD,                               /* read error */
//  TCEWRITE,                              /* wri        e error */
//  TCEMMAP,                               /* mmap error */
//  TCELOCK,                               /* lock error */
//  TCEUNLINK,                             /* unlink error */
//  TCERENAME,                             /* rename error */
//  TCEMKDIR,                              /* mkdir error */
//  TCERMDIR,                              /* rmdir error */
//  TCEKEEP,                               /* exis        ing record */
//  TCENOREC,                              /* no record found */
//  TCEMISC = 9999                         /* miscellaneous error */
//  TCESKELBDB= 10000,                         /*         he SKELBDB cus        om error */
//  TCEREMOVEINDEX                             /* remove index error */
//};

        ypedef s        ruc         {                         //         ype of s        ruc        ure for skel bdb da        abase
  TCBDB *bdb;                          // inner B++ Tree DB da        abase objec        s
  BDBCUR *cur;                           /* cursor of B+         ree */
} SKELBDB;

/*************************************************************************************************
 * API
 *************************************************************************************************/
bool         cADBSe        SkelBDB(TCADB *adb);
//void         cSkelBDBSe        Ecode(TCBDB *bdb, in         ecode, cons         char *filename, in         line, cons         char *func);
//cons         char *        cSkelBDBErrMsg(in         ecode);

__TCSKBDB_CLINKAGEEND
#endif                                   /* duplica        ion check */


/* END OF FILE */
